#ifndef _SINGLETON_H_
#define _SINGLETON_H_

template<typename T> 
class Singleton
{
	public:
		static T& Instance() 
		{
			if(m_self == 0)
			{
				m_self = new T();
			}
			return *m_self;
		}

		static T* Ptr()
		{
			if(m_self == 0)
			{
				m_self = new T();
			}
			return m_self;
		}

	private:
		static T* m_self;
};

template <typename T> 
T* Singleton<T>::m_self = 0;

#endif//_SINGLETON_H_
